package top.jianx.music.provider.netease;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import top.jianx.music.enums.MusicProvider;
import top.jianx.music.model.Album;
import top.jianx.music.model.BaseBean;
import top.jianx.music.util.SongUtils;

import java.util.List;

@Data
public class NeteaseAlbum extends BaseBean implements Album {
    @JSONField(name = "name")
    public String name;

    @JSONField(name = "id")
    public long id;

    @JSONField(name = "artists")
    public List<NeteaseArtist> artists;

    public List<NeteaseSong> songs;

    @JSONField(name = "picUrl")
    public String picUrl;

    @Override
    public String getAlbumId() {
        return String.valueOf(id);
    }

    @Override
    public String getFormattedArtistsString() {
        return SongUtils.getArtistsString(getArtists());
    }

    @Override
    public MusicProvider getMusicProvider() {
        return MusicProvider.Netease;
    }
}
